# -*- coding: utf-8 -*-
import sqlite3


con=sqlite3.connect(r'ndflow.db3')
con.row_factory = sqlite3.Row
cur=con.cursor()
f=open('f.txt','w')
for x in xrange(24,133):
    # s=cur.execute("select max(icpe),avg(icpe),max(ftx+frx)/1024,avg(ftx+frx)/1024 from ndflowlog where ndflowid=%d"%x).fetchall()
    # print s
    # f.write('%d\t%.1f\t%.1f\t%.1f\n'%(s[0][0],s[0][1],s[0][2],s[0][3]))
    
    s=cur.execute("select max(icpe),avg(icpe),max(ftx+frx)/1024,avg(ftx+frx)/1024 from ndflowlog where ndflowid=%d and (time(dtlog)>'20:00:00' and time(dtlog)<'22:00:00')"%x).fetchall()
    print s
    f.write('%d\t%.1f\t%.1f\t%.1f\n'%s[0])
con.close()